package com.liner.string;

/**
 * 截取当前字符串中指定范围的字符串(含头不含尾)
 */
public class SubstringDemo {
    public static void main(String[] args) {
        String str = "www.liner.com";
        int start = str.indexOf(".") + 1;
//        int end = str.lastIndexOf(".");
        //适用于双后缀
        int end = str.indexOf(".",start);

        System.out.println(str.substring(start, end));

    }
}
